<script setup>
// 清理缓存
import {message} from 'ant-design-vue'
import {ClearOutlined} from "@ant-design/icons-vue";

const instance = getCurrentInstance()
const handle = () => {
  const loading = instance.proxy.$refs.loading
  loading.show('正在清理缓存...')
  // 随机一个0~100的数字
  loading.update(Math.floor(Math.random() * 100))
  setTimeout(() => {
    loading.hide()
    message.success('清理缓存成功')
  }, 1000)
}
</script>

<template>
  <div class="inner-box btn bold" style="text-align:center;color: #fff;background: #389e0d;cursor: pointer;"
       @click="handle"
  >
    <ClearOutlined/>
    清理缓存
  </div>
  <loading-modal ref="loading"/>
</template>

<style scoped>

</style>
